<!DOCTYPE html>
<html>
<head>
<title>灵活报表元数据配置</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript">
        var path = window.document.location.href;
        var pathName = window.document.location.pathname;
        var hostPath = path.substring(0, path.indexOf(pathName));
        var projectName = pathName.substring(0, pathName.substr(1).indexOf("/") + 1);
        document.write('<scr' + 'ipt src="' + projectName + '/js/html/header.js"></scr'+'ipt>');
    </script>
</head>
<body>
	<table id="dg" style="width: auto; height: auto" fitColumns="true">
		<thead>
		<tr>
			<th field="id" data-options="hidden:true">ID</th>
			<th field="reportNo" align="right" width="100"
				data-options="
				sortable:true,
				remoteSort:false
				">报表编号</th>
			<th field="reportName" align="right" width="100"
				data-options="
				sortable:true,
				remoteSort:false
				">报表名称</th>
			<th field="viewDiv" align="right" width="100"
				data-options="
				sortable:true,
				remoteSort:false
				">视图控制</th>
			<th field="reportSql" align="right" width="100"
				data-options="
				sortable:true,
				remoteSort:false
				">SQL逻辑</th>
			<th field="previewUrl" align="right" width="100"
				data-options="
				sortable:true,
				remoteSort:false,
				formatter:formatterPreviewUrl
				">预览</th>
			<th field="conductUser" align="right" width="100"
				data-options="
				sortable:true,
				remoteSort:false
				">修改人</th>
			<th field="conductTime" align="right" width="100"
				data-options="
				sortable:true,
				remoteSort:false
				">修改时间</th>
		</tr>
		</thead>
	</table>
	<div id="dg-buttons" style="height: auto">
		<div style="margin-bottom:5px">
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" 	onclick="dlgAdd()">新增</a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" 	onclick="dlgRemove()">删除</a>
			<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" 	onclick="dlgEdit()">修改</a>
		</div>
		<div>
			<span>&nbsp;&nbsp;&nbsp;&nbsp;选择:</span>
			<input type="text" id="searchKey" name="searchKey" class="easyui-combobox" />
			<span>等于:</span>
			<input type="text" id="searchValue" name="searchValue" class="easyui-validatebox" />
			<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" onclick="dgop.find()">查询</a>
		</div>
	</div>
<div id="dlg-buttons">
		<a href="javascript:dlgSave()" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
		<a href="javascript:dlgClose()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
	</div>
	<div id="dlg" class="easyui-dialog" closed="true" style="width: 730px; height: 380px; padding: 10px 10px;" buttons="#dlg-buttons">
		<form method="post" id="fm">
			<table cellspacing="8px;">
				<td><input id="id" name="id" style="display: none" ></td>
				<tr>
					<td>报表编号</td>
					<td><input id="reportNo" name="reportNo" class="easyui-validatebox" required="true"
					>&nbsp;<span style="color: red">*</span>
					</td>
				</tr>
				<tr>
					<td>报表名称</td>
					<td><input id="reportName" name="reportName" class="easyui-validatebox" required="true"
					>&nbsp;<span style="color: red">*</span>
					</td>
				</tr>
				<tr>
					<td>VIEW_DIV</td>
					<td><input id="viewDiv" name="viewDiv" class="easyui-validatebox" required="true"
					>&nbsp;<span style="color: red">*</span>
					</td>
				</tr>
				<tr>
					<td>REPORT_SQL</td>
					<td><input id="reportSql" name="reportSql" class="easyui-textarea" required="true"
					>&nbsp;<span style="color: red">*</span>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div id="dlg-Details" class="easyui-window" closed="true" style="width: 730px; height: 280px; padding: 10px 10px;"></div>
	<script>
		var initd = {
			queryDataURL : "/report/meta/query.do",
			saveDataURL : "/report/meta/save.do",
			removeDataURL:"/report/meta/remove.do",
			dataDicList:{'ORG':['parentId'],'STATUS':['status'],'30':['orgGrade']},
			dg : $('#dg')
		};

		function formatterPreviewUrl(val, row, index) {
			return '<a href="javascript:openNewWin(\'' + projectName + row['previewUrl'] + '\',\''+ row['reportName'] +'\')">预览</a>';
		}

		function openNewWin(url, title)
		{
			window.open(url, title);
		}

	</script>
</body>
</html>
